package com.mrx.xfriendship.service.impl;

import com.mrx.xfriendship.converter.SecurityUserConverter;
import com.mrx.xfriendship.model.SecurityUser;
import com.mrx.xfriendship.service.ISecurityUserService;
import com.mrx.xfriendship.service.IUserService;
import org.springframework.lang.NonNull;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author Mr.X
 * @since 2023-01-14 21:17
 */
@Service
public class SecurityUserServiceImpl implements ISecurityUserService {

    @Resource
    private IUserService userService;

    @Resource
    private SecurityUserConverter securityUserConverter;

    @NonNull
    @Override
    public SecurityUser selectUserByName(String name) {
        return securityUserConverter.toSecurityUser(userService.loadSecurityUserByName(name));
    }

}
